module.exports = {
    configureWebpack: {
        //配置开发服务器
        devServer: {
            port: 8080, // 端口号
            host: 'localhost',
            https: false, // https:{type:Boolean}
            open: false, //配置自动启动浏览器
            /*
            proxy:{
                '/api':{
                    target:'',
                    changeOrigin:true
                }
            },
            */
            //启动项目时，首先运行
            before: app => {
                app.get('/api/v1/getList', (request, response) => {
                    //返回json数据
                    response.json({
                        result:'ok',
                        list: [{
                                id: 1,
                                name: "九号平衡车燃动版 米家定制 黑色",
                                imageUrl: "../../goods/balance_bike.jpg",
                                price: 2999,
                                number: 1,
                                totalPrice: 2999,
                                selected: true,
                                gift: []
                            },
                            {
                                id: 2,
                                name: "小米手表 标准版 典雅黑",
                                imageUrl: "../../goods/watch.jpg",
                                price: 1299,
                                number: 1,
                                totalPrice: 1299,
                                selected: true,
                                gift: [{
                                    id: 5,
                                    name: "小米蓝牙项圈耳机 青春版 黑色",
                                    imageUrl: "../../goods/headphone.jpg",
                                    number: 1
                                }]
                            },
                            {
                                id: 3,
                                name: "小米10 pro",
                                imageUrl: "../../goods/mi10pro.jpg",
                                price: 3999,
                                number: 1,
                                totalPrice: 3999,
                                selected: true,
                                gift: []
                            },
                            {
                                id: 4,
                                name: "Pro 15 增强版 i7 16G 1T PCIe MX250",
                                imageUrl: "../../goods/mibookpro15.jpg",
                                price: 5999,
                                number: 1,
                                totalPrice: 5999,
                                selected: true,
                                gift: [{
                                    id: 6,
                                    name: '小卫质品泡沫免洗抗菌洗手液 白色',
                                    imageUrl: "../../goods/liquid_soap.jpg",
                                    number: 1
                                }]
                            }
                        ]
                    });
                });
            }
        }
    }
}